<?php

use think\migration\Migrator;
use think\migration\db\Column;

class ControlSettingPollutantAnalysis extends Migrator
{
    /**
     * 管控 - 设置 - 贡献度分析
     */
    public function change()
    {
        $table = $this->table('control_setting_pollutant_analysis');
        $table
            //step1:相关管控ID
            ->addColumn('plan_id', 'integer', ['limit' => 4, 'comment' => '管控预案的ID',])
            //step2:污染物
            ->addColumn('pollutant_name', 'string', ['limit' => 50, 'comment' => '污染物名称',])
            ->addColumn('company_id', 'integer', ['limit' => 11, 'comment' => '溯源不为0的企业ID',])
            ->addColumn('company_name', 'integer', ['limit' => 11, 'comment' => '溯源不为0的企业名称',])
            ->addColumn('contribution_degree', 'string', ['limit' => 50, 'comment' => '贡献度',])
            //step3:列表中相关ID
            ->addColumn('station_id', 'integer', ['limit' => 11, 'comment' => '站点ID',])
            ->addColumn('control_point_id', 'integer', ['limit' => 11, 'comment' => '控点ID',])

            ->addColumn('create_time', 'integer', ['limit' => 11, 'comment' => '插入数据时间',])
            //注释
            ->setComment('管控 - 设置 - 贡献度分析')
            //引擎
            ->setEngine('InnoDB')
            ->save();
    }
}
